package com.lcredu.springboot.comtroller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author 黎长容
 * @date 2025-08-11 17:52
 */
//@RestController
@Controller
public class MonsterController {

    //在没有配置视图解析器前,返回结果是映射地址不存在导致的404
    //如果配置视图解析器,就会先按照视图解析器去查找
    //RestController会返回json数据

    @GetMapping("/monster")
    public String getMonster() {
        return "这是Get请求";
    }

    @PostMapping("/monster")
    public String postMonster() {
        return "这是Post请求";
    }

    @PutMapping("/monster")
    public String putMonster() {
        return "这是Put请求";
    }

    @DeleteMapping("/monster")
    public String deleteMonster() {
        return "这是Delete请求";
    }

    @RequestMapping("/find")
    public String findMonster() {
        return "ok";
    }
}
